#include "stdafx.h"
#include "CScroll.h"

static const UINT_32 SCROLL_AUTOREPAINT = AutoRepaintBackImageChanged | AutoRepaintMouseDownL |
	AutoRepaintMouseUpL;

CScroll::CScroll()
{
	SetAutoRepaint(SCROLL_AUTOREPAINT);
}
CScroll::CScroll(int_32 iX, int_32 iY, int_32 iWidth, int_32 iHeight)
	: CControl(iX, iY, iWidth, iHeight), CScrollBase(iWidth, iHeight)
{
	SetAutoRepaint(SCROLL_AUTOREPAINT);
}
CScroll::~CScroll()
{

}

const COID & CScroll::GetOID() const
{
	return OID_SCROLL;
}

void CScroll::MinValueChanged()
{
	Repaint();
	CScrollBase::MinValueChanged();
}

void CScroll::MaxValueChanged()
{
	Repaint();
	CScrollBase::MaxValueChanged();
}

void CScroll::ValueChanged()
{
	Repaint();
	CScrollBase::ValueChanged();
}

void CScroll::ScrollSizeChanged()
{
	Repaint();
	CScrollBase::ScrollSizeChanged();
}
void CScroll::LineValueChanged()
{
	Repaint();
	CScrollBase::LineValueChanged();
}

void CScroll::PageValueChanged()
{
	Repaint();
	CScrollBase::PageValueChanged();
}

void CScroll::ScrollPointChanged()
{
	Repaint();
	CScrollBase::ScrollPointChanged();
}

void CScroll::OnPaint(IPaint * pPaint, const CRectInt32 & rectClip) const
{
	OnPaintScroll(pPaint, GetImageState(), GetBaseAttr(), GetMouseState());
}

void CScroll::MouseDown(CMouseArgument & args)
{
	ScrollMouseDown(args);
	CControl::MouseDown(args);
}

void CScroll::MouseUp(CMouseArgument & args)
{
	ScrollMouseUp(args);
	CControl::MouseUp(args);
}

void CScroll::MouseMove(CMouseArgument & args)
{
	ScrollMouseMove(args);
	CControl::MouseMove(args);
}

void CScroll::MouseOut(CMouseArgument & args)
{
	ScrollMouseOut(args);
	CControl::MouseOut(args);
}

void CScroll::SizeChanged(CResizeArgument & args)
{
	SetScrollSize(GetSize());
	CControl::SizeChanged(args);
}
